﻿@model BenefitHelper.Sys.Operator
@{
    ViewBag.Title = "Edit";
}
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
<dl id="xiangmu">
    <dt>编辑操作员</dt>
</dl>
<div id="bigDataBox">
    @using (Html.BeginForm())
    {
        @Html.ValidationSummary(true)
            <input type="hidden" name="iid" value="@ViewBag.iid" />
        @Html.HiddenFor(model => model.Id)
        <table cellspacing="0" cellpadding="0" class="list" style="width: 100%;">
            <tr>
                <td style="text-align: left; padding-left: 10px;" class="title">
                    @Html.LabelFor(model => model.Username)
                </td>
                <td style="text-align: left; padding-left: 10px;">
                    @Html.EditorFor(model => model.Username)
                    @Html.ValidationMessageFor(model => model.Username)
                </td>
            </tr>
            <tr>
                <td style="text-align: left; padding-left: 10px;" class="title">
                    @Html.LabelFor(model => model.Password)
                </td>
                <td style="text-align: left; padding-left: 10px;">
                    @Html.EditorFor(model => model.Password)
                    @Html.ValidationMessageFor(model => model.Password)
                </td>
            </tr>
            <tr>
                <td style="text-align: left; padding-left: 10px;" class="title">
                    @Html.LabelFor(model => model.UName)
                </td>
                <td style="text-align: left; padding-left: 10px;">
                    @Html.EditorFor(model => model.UName)
                    @Html.ValidationMessageFor(model => model.UName)
                </td>
            </tr>
            <tr>
                <td style="text-align: left; padding-left: 10px;" class="title">
                    所属小组
                </td>
                <td style="text-align: left; padding-left: 10px;">
                    <select name="usergroup" id="usergroup">
                        @foreach (BenefitHelper.Sys.Groups g in ViewBag.groups)
                        {
                            if (g.Id == ViewBag.GroupId)
                            {
                            <option value="@g.Id" selected="selected">@g.GroupName</option>
                            }
                            else
                            { 
                            <option value="@g.Id">@g.GroupName</option>
                            }

                        }
                    </select>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                    <input type="checkbox" name="ismaster" id="ismaster" value="a" />
                    设定为组长
                </td>
            </tr>
            <tr>
                <td style="text-align: left; padding-left: 10px;" class="title">
                    @Html.LabelFor(model => model.Sex)
                </td>
                <td style="text-align: left; padding-left: 10px;">
                    @if (Model.Sex.Equals("男"))
                    {
                        <input name="Sex" value="男" type="radio" checked="checked" style="width: 10%; vertical-align: middle;" /><span>男</span>
                        <input name="Sex" value="女" type="radio" style="width: 10%; vertical-align: middle;" /><span>女</span>
                    }
                    else
                    {
                        <input name="Sex" value="男" type="radio" style="width: 10%; vertical-align: middle;" /><span>男</span>
                        <input name="Sex" value="女" type="radio" checked="checked" style="width: 10%; vertical-align: middle;" /><span>女</span>
                    }
                </td>
            </tr>
            <tr>
                <td style="text-align: left; padding-left: 10px;" class="title">
                    @Html.LabelFor(model => model.Email)
                </td>
                <td style="text-align: left; padding-left: 10px;">
                    @Html.EditorFor(model => model.Email)
                    @Html.ValidationMessageFor(model => model.Email)
                </td>
            </tr>
            <tr>
                <td style="text-align: left; padding-left: 10px;" class="title">
                    @Html.LabelFor(model => model.Phone)
                </td>
                <td style="text-align: left; padding-left: 10px;">
                    @Html.EditorFor(model => model.Phone)
                    @Html.ValidationMessageFor(model => model.Phone)
                </td>
            </tr>
        </table>
        <div style="height: 10px; line-height: 10px;">
        </div>
        <div style="text-align: right; padding-right: 30px;">
            <input type="submit" class="button1" value="保存" />&nbsp;&nbsp;&nbsp;&nbsp;<input
                type="button" class="button1" value="返回" onclick="javascript:history.go(-1)" />
        </div>
    }
</div>
